package team.future.joke.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import team.future.joke.constant.BaseConstants;
import team.future.joke.entity.Joke;
import team.future.joke.service.JokeService;

/**
 * Title: MobileShareController.java<br>
 * Description: <br>
 * Copyright (c) 未来工作室版权所有 2015    <br>
 * Create DateTime: 2015年9月22日 下午2:18:52 <br>
 * @author futurezhu
*/
@Controller
public class MobileShareController {

	@Autowired 
	private JokeService jokeService;

	@RequestMapping("/joke/share/detail")
	public String jokeShareDetail(ModelMap model,@RequestParam("id") String id) {
		Joke joke = jokeService.getJoke(id, null);
		model.put("title", joke.getTitle());
		model.put("content", joke.getContent());
		model.put("urlPre", BaseConstants.REAL_URL);
		return "/mobile/share";
	}

}
